package com.ch.forum.dao;

import com.ch.forum.model.SystemModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SystemParamMapper {

    @Select("select t.value from t_sys_info t where t.name = #{name}")
    String findValueByName(@Param("name")String name);

    @Select("select t.* from t_sys_info t")
    List<SystemModel> findAll();

    @Update("update t_sys_info set value = #{value} where name = #{name}")
    int updateValue(@Param("name")String name, @Param("value")String value);

}
